package com.study.zgw.nio;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Scanner;

public class TxtRead {
    public static void main(String[] args) {
        String fileName = "src/data.txt";
        try (FileInputStream inputStream = new FileInputStream(fileName);
             Scanner scanner = new Scanner(inputStream)) {
            while (scanner.hasNextLine()) {
                String line = scanner.nextLine();
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
